/**
 * Created by hcadmin on 16/4/12.
 */
define([
    "jquery",
    "IO",
    "bootbox"
], function ($, IO, bootbox) {

    $(function () {

        var year_1 = 1;
        var year_2 = 2;
        var year_3 = 3;

        var activity_mid=$("#activity_mid_hidden").val();

        //查询
        $("#btnSave1").bind("click", function () {
            var parmas={};
            parmas.activity_mid=activity_mid;
            parmas.year_id=1;

            IO.post('/shapan/api/CapitalAdd',parmas,function(c){

                    IO.post('/shapan/api/npadd',parmas,function(e){

                            IO.post('/shapan/api/TeamRankingAdd',parmas,function(d){
                                if(d.code==0){
                                    alert('报表生成成功');
                                }
                            })
                    })
            });
        });
        $("#btnSave2").bind("click", function () {
            var parmas2={};
            parmas2.activity_mid=activity_mid;
            parmas2.year_id=2;

            IO.post('/shapan/api/CapitalAdd',parmas2,function(c){

                IO.post('/shapan/api/npadd',parmas2,function(e){

                    IO.post('/shapan/api/TeamRankingAdd',parmas2,function(d){
                        if(d.code==0){
                            alert('报表生成成功');
                        }
                    })
                })
            });
        });
        $("#btnSave3").bind("click", function () {
            var parmas3={};
            parmas3.activity_mid=activity_mid;
            parmas3.year_id=3;
            IO.post('/shapan/api/CapitalAdd',parmas3,function(c){

                IO.post('/shapan/api/npadd',parmas3,function(e){

                    IO.post('/shapan/api/TeamRankingAdd',parmas3,function(d){
                        if(d.code==0){
                            alert('报表生成成功');
                        }
                    })
                })
            });
        });
    })
});